<?php
$lists=[];
foreach($domain_list as $dli){
	$li['id']=$dli['id'];
	$li['name']=$dli['name'];
	$li['port']=$dli['port'];
	$li['domain']=$dli['name'].(($dli['port']!=80)?$dli['port']:'');
	$li['pathin']='\\';
	$li['del']='dela='.$li['domain'];
	$lists[]=$li;
}
foreach($二级域名列表 as $dli){
	$li['id']=$dli['id'];
	$li['name']=$dli['domain'];
	$li['port']=$dli['port'];
	$li['domain']=$li['name'].(($dli['port']!=80)?$dli['port']:'');
	$li['pathin']='\\'.$dli['path'];
	$li['del']='delb='.$li['id'];
	$lists[]=$li;
}
?>

<div class="main">
	<div class="public_pa">域名绑定</div>
	<table class="table table-bordered">
		<thead>
			<tr>
    <td width="17%" style="border-left:0">操作</td>
    <td width="38%">域名</td>
    <td width="">目录</td>
	</tr>
		</thead>
				<tbody>
				
<?php foreach($lists as $dli){  ?>
	
  <tr>
    <td><!--<?=$dli['id']?>-->[<a href="?<?=$dli['del']?>">删除</a>]</td>
    <td>&nbsp;&nbsp;<?=$dli['domain']?></td>
    <td>&nbsp;&nbsp;<?=$dli['pathin']?></td>
  </tr>
   
 <?php } ?>
		
	</tbody></table>

		<table class="table">
			<thead>
			<tr>
    <td>域名绑定(域名绑定数量:<?=$域名已绑定数量?>/<?=$域名数量?> ,在添加绑定之前请先解析域名：<font color="red"><?=$GLOBALS['配置']['解析记录']?></font>)</td>
  </tr>
			</thead>
			<tbody>
			
  <tr>
    <td>
      <br />
	  <form id="form1" name="form1" method="post" action="">
      绑定域名:
      <input type="text" name="domain" id="domain" style="width: 80%;"/><br><br />
      绑定目录:
      <select name="dir"style="width: 80%;">
        <option value="/">主目录<?php if($user['子目录']==0) echo '(当前不允许绑定子目录)';?></option>
        <?php if($user['子目录']!=0){ foreach($二级目录 as $li=>$value){
			echo '<option value="'.$li.'">'.$value.'</option>';
		}}?>
		
      </select><br />
      <br />
      <input type="submit" name="add" id="add" value="提交" />
    </form></td>
  </tr>
		</tbody></table>
</div>